﻿using System;
using System.Collections.Generic;
using System.Text;

using MINERP.MODEL.FoundationModel;
using MINERP.MODEL.DisjoinProForOutShop;
using MINERP.COM;

namespace MINERP.MODEL.OverOrder
{
    /// <summary>
    /// 委外商格子里的所包含的产品的详情
    /// </summary>
    public class OverOrderView : GridDetailBase
    {
        ///// <summary>
        ///// 定单产品信息orderInfo
        ///// </summary>
        //public OrderInfo_Info  OrderProductInfo { get; set; }//
        ///// <summary>
        ///// 定单包信息
        ///// </summary>
        //public Tb_OrderBag_Info OrderBagInfo { get; set; }//
        ///// <summary>
        ///// 产品信息
        ///// </summary>
        //public Tb_Product_Info ProductInfo { get; set; }

        /// <summary>
        /// 委外记录信息
        /// </summary>
        public OutProcessRecord_Info OutRecordInfo { get; set; }


        //要在页面上显示的数据
        //public int OrderBagId { get { return OrderBagInfo.OrderBagId; } }

        //public int OrderProductId { get { return OrderProductInfo.OrderProductId; } }

        //public string OrderProductCode { get { return OrderProductInfo.OrderProductCode; } }

        //public string BagCode { get { return OrderBagInfo.BagCode; } }

        //public string BagName { get { return OrderBagInfo.BagName; } }

        //public string OrderProductName { get { return OrderProductInfo.OrderProductName; } }

        //public string ShopName { get { return OrderBagInfo.ShopName; } }

        //public string CtmName { get { return OrderProductInfo.CtmName; } }
        public int OutRecordId { get { return OutRecordInfo.OutProcessRecordId; } }

        public string OutShopName { get { return OutRecordInfo.OutShopInfo.OutShopName; } }

        //public int OrderInfosStatus { get { return OrderProductInfo.Status; } }

        public DateTime CreateTime { get { return OutRecordInfo.CreateTime; } }

        public DateTime PreFetchTime { get { return OutRecordInfo.PreFetchTime; } }

        public string OutRemark { get { return OutRecordInfo.OutRemark; } }

        public DateTime FetchTime { get { return OrderFetchTime; } }
        //public DateTime OrderFetchTime { get { return } }

        public string FetchRemark { get { return OutRecordInfo.FetchRemark; } }

        public string CreateUserName { get { return OutRecordInfo.CreateUser; } }

        public int OutShopid
        {
            get { return OutRecordInfo.OutShopInfo.OutShopId; }
        }

        public bool InGrid
        {
            get { return base.IsPrint; }
            set { }
        }
        public string status
        {
            get
            {
                switch ((OutProcessRecordStatus)OutRecordInfo.Status)
                {
                    case OutProcessRecordStatus.Outing: return "正在外加工中";
                        break;
                    case OutProcessRecordStatus.Fetched: return "已取件";
                        break;
                    case OutProcessRecordStatus.OutWaitFenDui: return "等待分堆";
                        break;
                    case OutProcessRecordStatus.InGrid: return "已分堆在格子中";
                        break;
                    default: return "error";
                        break;
                }
            }
        }
       
        public bool isCheck { get; set; }//委外格子复检用
       
        //public string ProductName
        //{
        //    get { return ProductInfo.ProductName; }
        //}
        //public string ProductCode
        //{
        //    get { return ProductInfo.ProductCode; }
        //}
        //public  int ProductNum
        //{
        //    get { return OrderProductInfo.ProductNum; }
        //}
        //public int Priority
        //{
        //    get { return OrderBagInfo.Priority; }
        //}
    }
}
